package com.css.fxfzysx.modules.specialMapAnalysis.controller;

import com.css.fxfzysx.base.response.RestResponse;
import com.css.fxfzysx.modules.specialMapAnalysis.service.SpecialService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("special")
@Slf4j
public class SpecialController {

    @Autowired
    SpecialService specialService;


    /**
     * 专项图分析
     * @param type
     * @param intensity
     * @return
     */
    @PostMapping("/specialMapAnalysis")
    public RestResponse specialMapAnalysis(String type, String intensity){
        RestResponse restResponse = null;
        try {
            Map map = specialService.specialMapAnalysis(type, intensity);
            restResponse = RestResponse.succeed(map);
            restResponse.setMessage("查询成功");
        } catch (Exception e) {
            String errormessage = "查询失败";
            restResponse = RestResponse.fail(errormessage);
            e.printStackTrace();
        }
        return restResponse;
    }


}
